package com.qf.feign;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.feign
 * @Description:
 * @Date 2022/7/6 22:27
 */

import com.qf.pojo.User;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * feign接口兜底类:
 * 如果被调用方抛异常, 为了用户体验, 可以直接返回这里兜底方法的结果,
 * 而不是直接返回异常信息给客户展示.
 * @author 千锋健哥
 */
@Component
@RequestMapping("/searchFallBack")
public class SearchFeignFallback implements SearchFegin {

    @Override
    public String test1() {
        return "繁忙，请稍后再试";
    }

    @Override
    public Object findById(Integer id) {
        return null;
    }

    @Override
    public Object findByIdAndName(Integer id, String name) {
        return null;
    }

    @Override
    public User save(User user) {
        return user;
    }
}
